function [im_sub_size,num0]=ifbadpicture(im,x_initial,x_final,y_initial,y_final,square)
%calculate number of some square's value in a image is zero,therefore
%evaluated pictures 
x_center=x_initial;
y_center=y_initial;
step=20;
num=zeros(2,1);
i=1;
while(x_center<=x_final)
   while (y_center<=y_final) 
      im_sub=im(y_center:y_center+square,x_center:x_center+square);
      im_sub_size=size(im_sub);
      num0=length(find(im_sub==0));
      num1=length(find(im_sub<=-1));
      num(i,1)=num0+num1;
      if i>1
         if num(i-1,1)<num(i,1)
             num(i-1,1)=num(i,1);
         end
      end
      i=2;
      y_center=y_center+step;
   end
   y_center=y_initial;
   x_center=x_center+step;
end
num0=num(1,1);